Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references to aggregation attribute on Workflows #4339

Merged
merged 7 commits into from
Jun 5, 2024

Conversation

zwolf
Copy link
Member

@zwolf zwolf commented May 31, 2024

The workflows table has an aggregation attribute that's going to collide with the new relation to the aggregations table. As far as I can tell, the only use for this was to indicate whether associated aggregation resources were "public" or "private".

This PR includes aggregation in the Workflow model's ignored_columns and removes references to this column from elsewhere. A subsequent PR will include the migration to remove the column from the database. Because ActiveRecord caches attributes at runtime (and aggregation is serialized on workflow resources), this will prevent exceptions between deployment and migration. I also needed to do some short circuiting in the policy specs, but they're all getting removed/rewritten in the batch agg PR.

Mostly this is to satisfy strong_migrations and stick to best practices. The migration PR will be a quick one to review/deploy before the batch agg PR merges.

Review checklist

  • First, the most important one: is this PR small enough that you can actually review it? Feel free to just reject a branch if the changes are hard to review due to the length of the diff.
  • If there are any migrations, will they the previous version of the app work correctly after they've been run (e.g. the don't remove columns still known about by ActiveRecord).
  • If anything changed with regards to the public API, are those changes also documented in the apiary.apib file?
  • Are all the changes covered by tests? Think about any possible edge cases that might be left untested.

@zwolf zwolf requested a review from yuenmichelle1 May 31, 2024 21:57
@@ -309,7 +311,7 @@
end

it 'updates the content model' do
expect{ resource.reload }.to change{ resource.strings }
expect{ resource.reload }.to change(resource, :strings)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceBeforeBlockBraces: Space missing to the left of {.

@zwolf
Copy link
Member Author

zwolf commented Jun 3, 2024

Seems most sensible to just deprecate the AggregationsController now in advance of #4303. This PR should fix the issues causing those specs to fail, and that PR fully refactors the AggregationsController and its spec.

@@ -87,7 +87,7 @@
expect(resolved_scope).to include(public_aggregation)
end

it 'includes aggregations from owned private projects' do
xit 'includes aggregations from owned private projects' do
Copy link
Collaborator

@yuenmichelle1 yuenmichelle1 Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are the plans with skipped tests? Mainly asking because I can see this easily being forgotten in history as skipped and never addressed again.

If the plans are to delete these tests, maybe we can do that now? Or maybe the batch aggregation PR/ a follow up PR will take care of these skipped tests removals/give these specs more context so that we can un-skip the tests.

Maybe adding a comment or something before the skipped tests to explain what the plan is would be helpful. BUT if this is quickly mitigated by the followup PR, them we can leave as is.

Copy link
Member Author

@zwolf zwolf Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything related to aggregations is being refactored by the batch aggregation PR. These bits also had to be skipped here because the notion of a private project was handled by the attribute that this removes. I'll remove them if you prefer, mostly just commented for clarity here and either way it's all getting removed when that PR merges (hopefully very soon!).

Copy link
Collaborator

@yuenmichelle1 yuenmichelle1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. I had one quick comment, but definitely not blocking.

@zwolf zwolf mentioned this pull request Jun 5, 2024
4 tasks
@zwolf zwolf merged commit db10db4 into master Jun 5, 2024
8 checks passed
@zwolf zwolf deleted the remove-agg-from-wf branch June 5, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants